package com.sgb.kjwl.view.ui.adapter.material;

import android.graphics.Typeface;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.Bean;
import com.swgk.core.util.UiUtil;

import java.util.List;

/**
 * 作者:张磊
 * 日期:2021/1/12 0008
 * 说明:商品1.3.6 商品类别选择
 */
public class ClassifyAdapter extends BaseQuickAdapter<Bean, BaseViewHolder> {


    public ClassifyAdapter(List<Bean> beans) {
        super(R.layout.classify_item, beans);
    }

    @Override
    protected void convert(BaseViewHolder helper, final Bean item) {
        helper.setText(R.id.tv_name, item.name).setTextColor(R.id.tv_name, UiUtil.getColor(item.select ? R.color.color_5792FD : R.color.color_333333)).setBackgroundColor(R.id.tv_name, UiUtil.getColor(item.select ? R.color.color_155792FD : R.color.FFFFFF96));
        TextView tv_name = helper.getView(R.id.tv_name);
        tv_name.setTypeface(item.select ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
    }
}